import 'package:fluro/fluro.dart';
import 'package:flutter_deer/index/page/banner_detail_page.dart';
import 'package:flutter_deer/index/page/betting_result_page.dart';
import 'package:flutter_deer/index/page/expenditure_progress_page.dart';
import 'package:flutter_deer/index/page/game_group_detail_page.dart';
import 'package:flutter_deer/index/page/historical_expenditure_page.dart';
import 'package:flutter_deer/index/page/indicator_document_page.dart';
import 'package:flutter_deer/routers/i_router.dart';
import 'page/capital_comparison_page.dart';
import 'page/execution_progress_page.dart';
import 'page/index_page.dart';
import 'page/index_detail_page.dart';

class IndexRouter implements IRouterProvider {
  static String indexPage = '/index';
  static String indexDetailPage = '/index/detail';
  static String groupDetailPage = '/index/groupDetailPage';
  static String bettingDetailPage = '/index/bettingDetailPage';
  static String bannerDetailPage = '/index/bannerDetailPage';
  static String indicatorDocumentListPage = '/index/indicatorDocumentListPage';
  static String executionProgressPage = '/index/executionProgressPage';
  static String capitalComparison = '/index/capitalComparison';
  static String historicalExpenditure = '/index/historicalExpenditure';
  static String expenditureProgress = '/index/expenditureProgress';
  
  @override
  void initRouter(FluroRouter router) {
    router.define(capitalComparison,
        handler: Handler(handlerFunc: (_, __) => const CapitalComparisonPage()));
    router.define(expenditureProgress,
        handler: Handler(handlerFunc: (_, __) => const ExpenditureProgressPage()));
    router.define(historicalExpenditure,
        handler: Handler(handlerFunc: (_, __) => const HistoricalExpenditurePage()));
    router.define(executionProgressPage,
        handler:
            Handler(handlerFunc: (_, __) => const ExecutionProgressPage()));
    router.define(indicatorDocumentListPage,
        handler:
            Handler(handlerFunc: (_, __) => const IndicatorDocumentPage()));
    router.define(indexPage,
        handler: Handler(handlerFunc: (_, __) => const IndexPage()));
    router.define(indexDetailPage,
        handler: Handler(handlerFunc: (_, __) => const IndexDetailPage()));
    router.define(groupDetailPage,
        handler: Handler(handlerFunc: (context, params) {
      final String? groupId = context!.settings!.arguments! as String;
      return GameGroupDetailPage(groupId: groupId);
    }));
    router.define(bettingDetailPage,
        handler: Handler(handlerFunc: (context, params) {
      final String? bettingId = context!.settings!.arguments! as String;
      return BettingResultPage(
        bettingId: bettingId,
      );
    }));
    router.define(bannerDetailPage,
        handler: Handler(handlerFunc: (context, params) {
      final String? id = context!.settings!.arguments! as String;
      return BannerDetailPage(
        id: id,
      );
    }));
  }
}
